def insert_n_m(n, m, i, j):
    mask = ~(~((~0) << (j - i + 1)) << i)
    n &= mask
    m <<= i
    n |= m
    return n


n = 0b10000000000
m = 0b10011
ans = insert_n_m(n, m, 2, 6)
print(bin(ans))
